﻿using CodeTemplate.DbHelper.CoreObj;
using iBing.Common.Common;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace CodeTemplate.CodeEdit
{
    public partial class FrmEditForQuery : Form
    {
        private List<ObjForQuery> conditions;

        public List<ObjForQuery> Conditions
        {
            get { return conditions; }
        }

        public FrmEditForQuery(List<ObjForQuery> conditions)
        {
            InitializeComponent();
            this.StartPosition = FormStartPosition.CenterParent;
            this.conditions = conditions;
            this.gridControl2.DataSource = this.conditions;

            //构建显示字典
            List<DictObject> dataForType = new List<DictObject>();
            dataForType.Add(new DictObject("文本", "text", ""));
            dataForType.Add(new DictObject("日期-天", "date", ""));
            dataForType.Add(new DictObject("日期-小时", "datetime", ""));
            dataForType.Add(new DictObject("下拉框[后台服务]", "comboxForServer", ""));
            dataForType.Add(new DictObject("下拉框[前台]", "comboxForClient", ""));
            dictForType.DataSource=dataForType;
            dictForType.DisplayMember="Name";
            dictForType.ValueMember = "Value";

        }

        private void btnOk_Click(object sender, EventArgs e)
        {
            this.DialogResult = System.Windows.Forms.DialogResult.OK;
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
        }

        private void gridControl1_EmbeddedNavigator_ButtonClick(object sender, DevExpress.XtraEditors.NavigatorButtonClickEventArgs e)
        {

        }
    }
}
